<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>公告详情</title>
<link href="${pageContext.request.contextPath}/asserts/bootstrap-3.3.7-dist/css/bootstrap.css" title=""
	rel="stylesheet" />
<link title="" href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css" />
<link title="blue" href="${pageContext.request.contextPath}/css/dermadefault.css" rel="stylesheet"
	type="text/css" />
<link title="green" href="${pageContext.request.contextPath}/css/dermagreen.css" rel="stylesheet"
	type="text/css" disabled="disabled" />
<link title="orange" href="${pageContext.request.contextPath}/css/dermaorange.css" rel="stylesheet"
	type="text/css" disabled="disabled" />
<!--<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
-->
<script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>

<script src="${pageContext.request.contextPath}/js/jquery.cookie.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/asserts/bootstrap-3.3.7-dist/js/bootstrap.min.js"
	type="text/javascript"></script>
</head>
<body>
<nav class="nav navbar-default navbar-mystyle">
		<div class="navbar-header">
			<button class="navbar-toggle" data-toggle="collapse"
				data-target=".navbar-collapse">
				<span class="icon-bar"></span> <span class="icon-bar"></span> <span
					class="icon-bar"></span>
			</button>
			<a class="navbar-brand mystyle-brand"><span
				class="glyphicon glyphicon-home"></span></a>
		</div>
		<div class="collapse navbar-collapse">
			<ul class="nav navbar-nav">
				<li class="li-border"><a class="mystyle-color navbar-brand" href="#">学生档案与资助平台</a>
				</li>
			 </ul>

			<ul class="nav navbar-nav pull-right">
				<li class="li-border"><a href="#" class="mystyle-color"> <span
						class="glyphicon glyphicon-bell"></span> <span class="topbar-num">0</span>
				</a></li>
				<li class="li-border dropdown"><a href="#"
					class="mystyle-color" data-toggle="dropdown"> <span
						class="glyphicon glyphicon-search"></span> 搜索
				</a>
					<div class="dropdown-menu search-dropdown">
						<div class="input-group">
							<input type="text" class="form-control"> <span
								class="input-group-btn">
								<button type="button" class="btn btn-default">搜索</button>
							</span> 
						</div>
					</div></li>   
				 
				<li class="dropdown li-border"><a href="#"
					class="dropdown-toggle mystyle-color" data-toggle="dropdown">
					      <span id="userInfo">${user.userlevel},${user.usercode}</span> 
						<span class="caret"></span>
				</a>
					<ul class="dropdown-menu">
						<li><a href="user/logout">退出</a></li>
					</ul></li>
				<li class="dropdown"><a href="#"
					class="dropdown-toggle mystyle-color" data-toggle="dropdown">换肤<span
						class="caret"></span></a>
					<ul class="dropdown-menu changecolor">
						<li id="blue"><a href="#">蓝色</a></li>
						<li class="divider"></li>
						<li id="green"><a href="#">绿色</a></li>
						<li class="divider"></li>
						<li id="orange"><a href="#">橙色</a></li>
					</ul></li>
			</ul>
		</div>
	</nav>
	<div class="container">
			<center><h1>${notice.name }</h1></center>
			<center> 发布时间：<fmt:formatDate value="${notice.createdate}" pattern="yyyy-MM-dd HH:mm:ss"/>  &nbsp;&nbsp;发布者：公安县学生资助与经费支付中心 </center>
			<hr/>
			<div style="min-height:300px;">
				<p >
				 ${notice.content }
				     
				</p>
			</div>
			 
			<p>
			 <b> 附件（可下载）：</b>
			 <c:if test="${notice.filepath==''}">暂无</c:if>
			  <c:if test="${notice.filepath!=''}">
			      <a href="javascript:void(0);" onclick="downInfo(${notice.id})" title="下载资料">${notice.filepath}</a>
			 </c:if>
			</p>
			 
			 <b>已阅学校：</b>
			   <c:forEach items="${userList}" var="u" varStatus="v">
			   		<c:if test="${u.username=='县直'}">
			   			  <a class="label label-danger" onclick="clickXian(${notice.id},${u.userId})"> ${u.username}</a> 
			   		</c:if>
			   		<c:if test="${u.username!='县直'}">
			   			<span class="label label-success"> ${u.username}</span>
			   		</c:if>
			  	 	
			   	    <%--  <c:if test="${(v.index+1)%6==0 }">
				    	<br/>
				   	 </c:if> --%>
			   </c:forEach>
			 
			 
			</p>
			<div id="schoolInfo"></div>
	</div>
	
			 
</body>
<script type="text/javascript">
function downInfo(id){
	
	// alert(id);
	 location.href="downFile?id="+id+"&d="+Math.random();
}

function clickXian(noticeId,userId){
	if( $("#schoolInfo").html()==''){
	 $.ajax({
			type:"post",
			url:"selectSchoolNameByXZId",
			data:"userId="+userId+"&noticeId="+noticeId, //表示是学校级别
			dataType:"JSON",
			success:function(data){
			      if(data!=""){
			    	  var school="";
			    	  for(var i=0;i<data.length;i++){
			    		  school+="<span class=\"label label-success\">"+data[i].username+"</span>  ";
			    	  }
			    	  $("#schoolInfo").html(school);
			      }
			      
			}
			
		});
	}
}
</script>

</html>